package xy.donate.android.db;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import java.util.List;

import xy.donate.android.entity.AddressEntity;

@Dao
public interface AddressDao {

    //插入
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(AddressEntity entity);

    //删除
    @Query("delete from AddressEntity where AddressID =:userID")
    void deleteLogin(String userID);

    //查询所有
    @Query("select * from AddressEntity where UserID = :userID")
    List<AddressEntity> getAll(String userID);

}
